<?php

final class MenuQueries {
    private static $getMenu = "SELECT id, title, description, link, type, `left`, `right` FROM links
                              WHERE isnavi = ? AND (page LIKE ? OR page IS NULL) ORDER BY `left` ASC";

    private function __construct() {} // So the class can't be instantiated.

    public static function GetMenu($isnavi, $id) {
        $registry = Registry::GetInstance();
        $DB = $registry->Get('DB');
        $query = new pQuery(self::$getMenu);
        $DB->Query($query);
        $query->SetParams($isnavi, '%' . $id . '%');
        return $query->FetchResult();
    }
}